package com.sg.service.base.component.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.sg.common.util.CommonFunctionHelper;
import com.sg.entity.OmsPlatformOperationSeparatedData;
import com.sg.service.base.component.MOmsPlatformOperationSeparatedDataService;
import com.wicket.okrcomponent.dal.mapper.mbg.OmsPlatformOperationSeparatedDataMapper;
import org.apache.skywalking.apm.toolkit.trace.Tag;
import org.apache.skywalking.apm.toolkit.trace.Tags;
import org.apache.skywalking.apm.toolkit.trace.Trace;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author ：
 * @version 1.0
 * @since 2022/1/19 15:39
 */
@Service
public class MOmsPlatformOperationSeparatedDataServiceImpl
        extends ServiceImpl<OmsPlatformOperationSeparatedDataMapper, OmsPlatformOperationSeparatedData>
        implements MOmsPlatformOperationSeparatedDataService {

    @Autowired
    OmsPlatformOperationSeparatedDataMapper omsPlatformOperationSeparatedDataMapper;

    /**
     * M2修改租户分离数据[7206]
     * gen by moon at 6/12/2023, 11:21:02 AM
     */
    @Trace(operationName = "M2修改租户分离数据")
    @Tags({@Tag(key = "参数", value = "arg[0]"),
            @Tag(key = "返回值", value = "returnedObj")})
    @Override
    @Transactional(rollbackFor = Exception.class)
    public boolean updateTenantSeparationData(OmsPlatformOperationSeparatedData omsPlatformOperationSeparatedData) {
        omsPlatformOperationSeparatedData.setOperationInductionId(CommonFunctionHelper.getBaseInfoFromLocal().getSpecInductionRecordId());//CURRENT_INDUCTIONID
        omsPlatformOperationSeparatedData.setOperateTime(CommonFunctionHelper.getCurrentTime());//SYSTEM_CURRENT_TIME
        return super.updateById(omsPlatformOperationSeparatedData);
    }
}
